home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 March / maximum-cd-2000-03.iso / Quake3 Game Source / Q3AGameSource.exe / Main / cg_public.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-18  |  4.3 KB  |  165 lines

  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3.  
  4.  
  5. #define    CMD_BACKUP            64    
  6. #define    CMD_MASK            (CMD_BACKUP - 1)
  7. // allow a lot of command backups for very fast systems
  8. // multiple commands may be combined into a single packet, so this
  9. // needs to be larger than PACKET_BACKUP
  10.  
  11.  
  12. #define    MAX_ENTITIES_IN_SNAPSHOT    256
  13.  
  14. // snapshots are a view of the server at a given time
  15.  
  16. // Snapshots are generated at regular time intervals by the server,
  17. // but they may not be sent if a client's rate level is exceeded, or
  18. // they may be dropped by the network.
  19. typedef struct {
  20.     int                snapFlags;            // SNAPFLAG_RATE_DELAYED, etc
  21.     int                ping;
  22.  
  23.     int                serverTime;        // server time the message is valid for (in msec)
  24.  
  25.     byte            areamask[MAX_MAP_AREA_BYTES];        // portalarea visibility bits
  26.  
  27.     playerState_t    ps;                        // complete information about the current player at this time
  28.  
  29.     int                numEntities;            // all of the entities that need to be presented
  30.     entityState_t    entities[MAX_ENTITIES_IN_SNAPSHOT];    // at the time of this snapshot
  31.  
  32.     int                numServerCommands;        // text based server commands to execute when this
  33.     int                serverCommandSequence;    // snapshot becomes current
  34. } snapshot_t;
  35.  
  36.  
  37. /*
  38. ==================================================================
  39.  
  40. functions imported from the main executable
  41.  
  42. ==================================================================
  43. */
  44.  
  45. #define    CGAME_IMPORT_API_VERSION    3
  46.  
  47. typedef enum {
  48.     CG_PRINT,
  49.     CG_ERROR,
  50.     CG_MILLISECONDS,
  51.     CG_CVAR_REGISTER,
  52.     CG_CVAR_UPDATE,
  53.     CG_CVAR_SET,
  54.     CG_CVAR_VARIABLESTRINGBUFFER,
  55.     CG_ARGC,
  56.     CG_ARGV,
  57.     CG_ARGS,
  58.     CG_FS_FOPENFILE,
  59.     CG_FS_READ,
  60.     CG_FS_WRITE,
  61.     CG_FS_FCLOSEFILE,
  62.     CG_SENDCONSOLECOMMAND,
  63.     CG_ADDCOMMAND,
  64.     CG_SENDCLIENTCOMMAND,
  65.     CG_UPDATESCREEN,
  66.     CG_CM_LOADMAP,
  67.     CG_CM_NUMINLINEMODELS,
  68.     CG_CM_INLINEMODEL,
  69.     CG_CM_LOADMODEL,
  70.     CG_CM_TEMPBOXMODEL,
  71.     CG_CM_POINTCONTENTS,
  72.     CG_CM_TRANSFORMEDPOINTCONTENTS,
  73.     CG_CM_BOXTRACE,
  74.     CG_CM_TRANSFORMEDBOXTRACE,
  75.     CG_CM_MARKFRAGMENTS,
  76.     CG_S_STARTSOUND,
  77.     CG_S_STARTLOCALSOUND,
  78.     CG_S_CLEARLOOPINGSOUNDS,
  79.     CG_S_ADDLOOPINGSOUND,
  80.     CG_S_UPDATEENTITYPOSITION,
  81.     CG_S_RESPATIALIZE,
  82.     CG_S_REGISTERSOUND,
  83.     CG_S_STARTBACKGROUNDTRACK,
  84.     CG_R_LOADWORLDMAP,
  85.     CG_R_REGISTERMODEL,
  86.     CG_R_REGISTERSKIN,
  87.     CG_R_REGISTERSHADER,
  88.     CG_R_CLEARSCENE,
  89.     CG_R_ADDREFENTITYTOSCENE,
  90.     CG_R_ADDPOLYTOSCENE,
  91.     CG_R_ADDLIGHTTOSCENE,
  92.     CG_R_RENDERSCENE,
  93.     CG_R_SETCOLOR,
  94.     CG_R_DRAWSTRETCHPIC,
  95.     CG_R_MODELBOUNDS,
  96.     CG_R_LERPTAG,
  97.     CG_GETGLCONFIG,
  98.     CG_GETGAMESTATE,
  99.     CG_GETCURRENTSNAPSHOTNUMBER,
  100.     CG_GETSNAPSHOT,
  101.     CG_GETSERVERCOMMAND,
  102.     CG_GETCURRENTCMDNUMBER,
  103.     CG_GETUSERCMD,
  104.     CG_SETUSERCMDVALUE,
  105.     CG_R_REGISTERSHADERNOMIP,
  106.     CG_MEMORY_REMAINING,
  107.  
  108.     CG_MEMSET = 100,
  109.     CG_MEMCPY,
  110.     CG_STRNCPY,
  111.     CG_SIN,
  112.     CG_COS,
  113.     CG_ATAN2,
  114.     CG_SQRT,
  115.     CG_FLOOR,
  116.     CG_CEIL,
  117.  
  118.     CG_TESTPRINTINT,
  119.     CG_TESTPRINTFLOAT
  120. } cgameImport_t;
  121.  
  122.  
  123. /*
  124. ==================================================================
  125.  
  126. functions exported to the main executable
  127.  
  128. ==================================================================
  129. */
  130.  
  131. typedef enum {
  132.     CG_INIT,
  133. //    void CG_Init( int serverMessageNum, int serverCommandSequence )
  134.     // called when the level loads or when the renderer is restarted
  135.     // all media should be registered at this time
  136.     // cgame will display loading status by calling SCR_Update, which
  137.     // will call CG_DrawInformation during the loading process
  138.     // reliableCommandSequence will be 0 on fresh loads, but higher for
  139.     // demos, tourney restarts, or vid_restarts
  140.  
  141.     CG_SHUTDOWN,
  142. //    void (*CG_Shutdown)( void );
  143.     // oportunity to flush and close any open files
  144.  
  145.     CG_CONSOLE_COMMAND,
  146. //    qboolean (*CG_ConsoleCommand)( void );
  147.     // a console command has been issued locally that is not recognized by the
  148.     // main game system.
  149.     // use Cmd_Argc() / Cmd_Argv() to read the command, return qfalse if the
  150.     // command is not known to the game
  151.  
  152.     CG_DRAW_ACTIVE_FRAME,
  153. //    void (*CG_DrawActiveFrame)( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback );
  154.     // Generates and draws a game scene and status information at the given time.
  155.     // If demoPlayback is set, local movement prediction will not be enabled
  156.  
  157.     CG_CROSSHAIR_PLAYER,
  158. //    int (*CG_CrosshairPlayer)( void );
  159.  
  160.     CG_LAST_ATTACKER
  161. //    int (*CG_LastAttacker)( void );
  162. } cgameExport_t;
  163.  
  164. //----------------------------------------------
  165.